Extendscript After Effects
snippet | |
---|---|
// description to stranger // 1. Select layer // 2. // 3. // running condtions: // 1. Works better with a centered anchor // allows acess to file with all functions app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ function rotation1(a,b){ app.project.item(active_item).layer(selected_layer).property("Transform").property("Rotation").setValueAtTime([a],[b]); } function accelerating_rotation(a,b,c){ rotation1(a,0) for(ii=1;ii<=(b-a);ii++){ var current_rotation = app.project.item(active_item).layer(selected_layer).property("ADBE Transform Group").property("Rotation").valueAtTime(ii, false) rotation1(a+ii,current_rotation+c*ii) } } accelerating_rotation(0,10,100) app.endUndoGroup(); | |
app.project.item(1).layer(1).Effects.addProperty("CC blobbylize"); | |
app.project.item(1).layer(1).Effects.addProperty("CC Lens"); | |
app.project.item(1).layer(1).Effects.addProperty("CC Flo Motion"); | |
// running condtions: //1. light type has to be set in advance var ww = app.project.activeItem.width; var hh = app.project.activeItem.height; var x = 0 var light_name = "light_" + x app.project.item(1).layers.addLight(light_name, [ww/2,hh/2]) | |
// description to stranger // 1. add light // 2. // 3. // running condtions: //1. light type has to be set in advance // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var ww = app.project.activeItem.width; var hh = app.project.activeItem.height; var x = 0 var light_name = "light_" + x app.project.item(1).layers.addLight(light_name, [ww/2,hh/2]) app.endUndoGroup(); | |
app.project.item(1).layer(1).Effects.addProperty("Lightning"); | |
app.project.item(1).layer(1).Effects.addProperty("CC Particle World"); | |
// get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ app.project.item(active_item).layer(selected_layer).Effects.addProperty("Wave Warp"); | |
// description to stranger // 1. briefly gets a layer // 2. // 3. // running condtions: // asusme project item 2 // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); function layerget(a){ var x1s = app.project.item(2).layer(a) return x1s } var x2 = layerget(2) alert(x2.name) app.endUndoGroup(); | |
function layerget(a){ var x1s = app.project.item(1).layer(a) return x1s } var l1 = layerget(1) alert(l1.name) | |
// description to stranger // 1. center mask asnd scale to fill comp // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // upscale based on mask size cc tile // decalre varailbe for width and height var ww = app.project.item(a).width; var hh = app.project.item(a).height; // decalre arrays to stora all x and y verticies var vertices_x_array = [] var vertices_y_array = [] for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); var max_x= Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var max_y= Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); // get side length as max minus min x var x_side_length = (Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]))-min_x; // get vrtical side legnth var y_side_length = (Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]))-min_y; // chek which is longer x or y to make perferct symmetric var longer_side = ""; var xy_differnce = 0; if(x_side_length>y_side_length){ longer_side="x"; var xy_differnce = x_side_length-y_side_length }else{ longer_side="y" var xy_differnce = y_side_length-x_side_length } // move to center app.project.item(2).layer(a).property("Transform").property("Anchor Point").setValueAtTime(0,[min_x+(x_side_length/2),min_y+(y_side_length/2)]); // scale up if(longer_side=="y"){scale1(a,0,(ww/x_side_length)*100,(ww/x_side_length)*100)} if(longer_side=="x"){scale1(a,0,(hh/y_side_length)*100,(hh/y_side_length)*100)} app.endUndoGroup(); | |
// description to stranger // 1. cnether mask using an chor // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // upscale based on mask size cc tile // decalre varailbe for width and height var ww = app.project.item(a).width; var hh = app.project.item(a).height; // decalre arrays to stora all x and y verticies var vertices_x_array = [] var vertices_y_array = [] for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); var max_x= Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var max_y= Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); // get side length as max minus min x var x_side_length = (Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]))-min_x; // get vrtical side legnth var y_side_length = (Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]))-min_y; // chek which is longer x or y to make perferct symmetric var longer_side = ""; var xy_differnce = 0; if(x_side_length>y_side_length){ longer_side="x"; var xy_differnce = x_side_length-y_side_length }else{ longer_side="y" var xy_differnce = y_side_length-x_side_length } // move to center app.project.item(2).layer(a).property("Transform").property("Anchor Point").setValueAtTime(0,[min_x+(x_side_length/2),min_y+(y_side_length/2)]); app.endUndoGroup(); | |
// description to stranger // 1. cnether mask using an chor // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // upscale based on mask size cc tile // decalre varailbe for width and height var ww = app.project.item(a).width; var hh = app.project.item(a).height; // decalre arrays to stora all x and y verticies var vertices_x_array = [] var vertices_y_array = [] for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(2).layer(a)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); var max_x= Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var max_y= Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); // get side length as max minus min x var x_side_length = (Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]))-min_x; // get vrtical side legnth var y_side_length = (Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]))-min_y; // chek which is longer x or y to make perferct symmetric var longer_side = ""; var xy_differnce = 0; if(x_side_length>y_side_length){ longer_side="x"; var xy_differnce = x_side_length-y_side_length }else{ longer_side="y" var xy_differnce = y_side_length-x_side_length } // move to center app.project.item(2).layer(a).property("Transform").property("Anchor Point").setValueAtTime(0,[min_x+(x_side_length/2),min_y+(y_side_length/2)]); app.endUndoGroup(); | |
// decalre varailbe for width and height var ww = app.project.item(1).width; var hh = app.project.item(1).height; // decalre arrays to stora all x and y verticies var vertices_x_array = [] var vertices_y_array = [] // fill array with vertices for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); var max_x= Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var max_y= Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); // get side length as max minus min x var x_side_length = (Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]))-min_x; // get vrtical side legnth var y_side_length = (Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]))-min_y; // move to center app.project.item(1).layer(1).property("Transform").property("Anchor Point").setValueAtTime(0,[min_x+(x_side_length/2),min_y+(y_side_length/2)]); | |
// decalre varailbe for width and height var ww = app.project.item(1).width; var hh = app.project.item(1).height; // decalre arrays to stora all x and y verticies var vertices_x_array = [] var vertices_y_array = [] // fill vertices arrays for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point in rectangle var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); var max_x= Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var max_y= Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); // get side length as max minus min x var x_side_length = (Math.max(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]))-min_x; // get vertical side legnth var y_side_length = (Math.max(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]))-min_y; // chek which is longer x or y to make perferct symmetric var longer_side = ""; var xy_differnce = 0; if(x_side_length>y_side_length){ longer_side="x"; var xy_differnce = x_side_length-y_side_length }else{ longer_side="y" var xy_differnce = y_side_length-x_side_length } // move to center app.project.item(1).layer(1).property("Transform").property("Anchor Point").setValueAtTime(0,[min_x+(x_side_length/2),min_y+(y_side_length/2)]); // asign scale property to variable var x2s = app.project.item(1).layer(1).property("Transform").property("Scale") // scale up if(longer_side=="y"){ x2s.setValueAtTime([0], [(ww/x_side_length)*100,(ww/x_side_length)*100]); } if(longer_side=="x"){ x2s.setValueAtTime([0], [(hh/y_side_length)*100,(hh/y_side_length)*100]); } | |
var myShape = new Shape(); myShape.vertices = [[0,0],[0,100],[100,100],[100,0]]; var myMask = app.project.item(1).layer(1).property("ADBE Mask Parade").property(1); myMask.property("ADBE Mask Shape").setValue(myShape); | |
// description to stranger // 1. // 2. // 3. // running condtions: // 1, you have to specifiy the vertices. if you want to hcange just get the other place them and the vaolue you want for the one // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var myShape = new Shape(); myShape.vertices = [[0,0],[0,100],[100,100],[100,0]]; var myMask = app.project.item(a).layer(b).property("ADBE Mask Parade").property(1); myMask.property("ADBE Mask Shape").setValue(myShape); app.endUndoGroup(); | |
// description to stranger // 1. check if two maks over lap // 2. // 3. // running condtions: // 3.square maks // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var mask_1_vertices_x_array = [] var mask_1_vertices_y_array = [] var mask_2_vertices_x_array = [] var mask_2_vertices_y_array = [] for(ii=0;ii<4;ii++){ mask_1_vertices_x_array.push(app.project.item(2).layer(2)("Masks")(1).property("Mask Path").value.vertices[ii][0]) mask_1_vertices_y_array.push(app.project.item(2).layer(2)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var mask_1_min_x= Math.min(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_min_y= Math.min(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); var mask_1_max_x= Math.max(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_max_y= Math.max(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); for(ii=0;ii<4;ii++){ mask_2_vertices_x_array.push(app.project.item(2).layer(2)("Masks")(2).property("Mask Path").value.vertices[ii][0]) mask_2_vertices_y_array.push(app.project.item(2).layer(2)("Masks")(2).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var mask_2_min_x= Math.min(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_min_y= Math.min(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); var mask_2_max_x= Math.max(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_max_y= Math.max(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); // check if toip let point of either is wihtin the other if((mask_1_min_x<=mask_2_max_x && mask_1_min_x>=mask_2_min_x && mask_1_min_y<=mask_2_max_y && mask_1_min_y>=mask_2_min_y)||(mask_2_min_x<=mask_1_max_x && mask_2_min_x>=mask_1_min_x && mask_2_min_y<=mask_1_max_y && mask_2_min_y>=mask_1_min_y)){alert("overlap")}else{alert("no overlap")} app.endUndoGroup(); | |
// description to stranger // 1. check if two maks over lap // 2. // 3. // running condtions: // 3.square maks // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var mask_1_vertices_x_array = [] var mask_1_vertices_y_array = [] var mask_2_vertices_x_array = [] var mask_2_vertices_y_array = [] for(ii=0;ii<4;ii++){ mask_1_vertices_x_array.push(app.project.item(2).layer(2)("Masks")(1).property("Mask Path").value.vertices[ii][0]) mask_1_vertices_y_array.push(app.project.item(2).layer(2)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var mask_1_min_x= Math.min(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_min_y= Math.min(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); var mask_1_max_x= Math.max(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_max_y= Math.max(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); for(ii=0;ii<4;ii++){ mask_2_vertices_x_array.push(app.project.item(2).layer(2)("Masks")(2).property("Mask Path").value.vertices[ii][0]) mask_2_vertices_y_array.push(app.project.item(2).layer(2)("Masks")(2).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var mask_2_min_x= Math.min(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_min_y= Math.min(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); var mask_2_max_x= Math.max(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_max_y= Math.max(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); // check if toip let point of either is wihtin the other if((mask_1_min_x<=mask_2_max_x && mask_1_min_x>=mask_2_min_x && mask_1_min_y<=mask_2_max_y && mask_1_min_y>=mask_2_min_y)||(mask_2_min_x<=mask_1_max_x && mask_2_min_x>=mask_1_min_x && mask_2_min_y<=mask_1_max_y && mask_2_min_y>=mask_1_min_y)){alert("overlap")}else{alert("no overlap")} app.endUndoGroup(); | |
// create arrays to store vertices var mask_1_vertices_x_array = [] var mask_1_vertices_y_array = [] var mask_2_vertices_x_array = [] var mask_2_vertices_y_array = [] // fill array with first mask vertices for(ii=0;ii<4;ii++){ mask_1_vertices_x_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][0]) mask_1_vertices_y_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum value of x and y vertices arrays giving you top left point in square var mask_1_min_x= Math.min(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_min_y= Math.min(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); var mask_1_max_x= Math.max(mask_1_vertices_x_array[0],mask_1_vertices_x_array[1],mask_1_vertices_x_array[2],mask_1_vertices_x_array[3]); var mask_1_max_y= Math.max(mask_1_vertices_y_array[0],mask_1_vertices_y_array[1],mask_1_vertices_y_array[2],mask_1_vertices_y_array[3]); // fill array with second mask vertices for(ii=0;ii<4;ii++){ mask_2_vertices_x_array.push(app.project.item(1).layer(1)("Masks")(2).property("Mask Path").value.vertices[ii][0]) mask_2_vertices_y_array.push(app.project.item(1).layer(1)("Masks")(2).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum value of x and y vertices arrays giving you top left point in square var mask_2_min_x= Math.min(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_min_y= Math.min(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); var mask_2_max_x= Math.max(mask_2_vertices_x_array[0],mask_2_vertices_x_array[1],mask_2_vertices_x_array[2],mask_2_vertices_x_array[3]); var mask_2_max_y= Math.max(mask_2_vertices_y_array[0],mask_2_vertices_y_array[1],mask_2_vertices_y_array[2],mask_2_vertices_y_array[3]); // check if top let point of either square is wihtin the other if((mask_1_min_x<=mask_2_max_x && mask_1_min_x>=mask_2_min_x && mask_1_min_y<=mask_2_max_y && mask_1_min_y>=mask_2_min_y)||(mask_2_min_x<=mask_1_max_x && mask_2_min_x>=mask_1_min_x && mask_2_min_y<=mask_1_max_y && mask_2_min_y>=mask_1_min_y)){alert("overlap")}else{alert("no overlap")} | |
// copied from var layObj = app.project.item(1).layer(1) // copied to var layObj2 = app.project.item(1).layer(2) var r = getMaskPaths(layObj); app.beginUndoGroup("1"); setMaskPaths(layObj2, r); app.endUndoGroup(); function getMaskPaths(layObj){ var paths, pathNames, masksGrp, masksGrpLen, curMask; paths = new Array(); pathNames= new Array(); if(layObj instanceof AVLayer){ masksGrp = layObj.property("ADBE Mask Parade"); masksGrpLen = masksGrp.numProperties; if(masksGrpLen > 0){ for(var m=1; m<=masksGrpLen; m++){ curMask = masksGrp.property(m).property("ADBE Mask Shape").value; pathNames.push(masksGrp.property(m).name); paths.push(curMask); } } } if(paths.length > 0){ return [pathNames, paths]; }else{ return null; } } function setMaskPaths(layObj, maskData){ var maskDataLen, curData, newShape, newMask, comp, addShape, addVectorGroup; maskDataLen = maskData[1].length; if(maskDataLen > 0){ for(var s=0; s newShape = new Shape(); newShape.vertices = curData.vertices; newShape.inTangents = curData.inTangents; newShape.outTangents = curData.outTangents; newShape.closed = curData.closed; newShape.featherSegLoc = curData.featherSegLoc; newShape.featherRelSegLocs = curData.featherRelSegLocs; newShape.featherRadii = curData.featherRadii; newShape.featherInterps = curData.featherInterps; newShape.featherTensions = curData.featherTensions; newShape.featherTypes = curData.featherTypes; newShape.featherRelCornerAngles = curData.featherRelCornerAngles; newMask = layObj.property("ADBE Mask Parade").addProperty("Mask"); newMask.property("ADBE Mask Shape").setValue(newShape); newMask.name = maskData[0][s]; } } } | |
var targetFile = File("E:/2/xxx.txt"); targetFile.open("r"); var lines = targetFile.read().split(/[\r\n]+/g); targetFile.close(); alert(lines.length); | |
// duplicate app.project.item(1).layer(1).duplicate() // turn to adjustmnet layer app.project.item(1).layer(1).adjustmentLayer = true; | |
// description to stranger // 1. create adjusment layer // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // ducplaite app.project.item(2).layer(2).duplicate() // turn to adjusmnet layer app.project.item(2).layer(2).adjustmentLayer = true; // rename app.project.item(2).layer(2).name = "adjustment layer"; app.endUndoGroup(); | |
var thisLayer = app.project.item(1).layer(1); newMask = thisLayer.Masks.addProperty("Mask"); var shape = newMask.property("ADBE Mask Shape"); var path = shape.value; path.vertices = [[300,300],[300,400],[400,400],[400,300]]; var itArray = [[1,0],[1,0],[1,0],[1,0],[1,0],[1,0]]; var otArray = [[-1,0],[-1,0],[-1,0],[-1,0],[-1,0],[-1,0]]; path.inTangents = itArray ; path.outTangents = otArray; path.closed = true; shape.setValue(path); newMask.rotoBezier = true; | |
var myWin = new Window("palette", "My Window", undefined); var groupOne = myWin.add("group", undefined, "GroupOne"); groupOne.add("button", undefined, "Button"); myWin.center(); myWin.show(); | |
var myWin = new Window("palette", "My Window", undefined); var groupOne = myWin.add("group", undefined, "GroupOne"); groupOne.add("checkbox", undefined, "CheckBox"); myWin.center(); myWin.show(); | |
var myWin = new Window("palette", "My Window", undefined); var groupOne = myWin.add("group", undefined, "GroupOne"); var dd = groupOne.add("dropdownlist", undefined, ["Item 1", "Item 2", "Item 3"]); dd.selection = 0; myWin.center(); myWin.show(); | |
var myWin = new Window("palette", "My Window", undefined); var groupOne = myWin.add("group", undefined, "GroupOne"); groupOne.add("progressbar", undefined, "ProgressBar"); myWin.center(); myWin.show(); | |
var myWin = new Window("palette", "My Window", undefined); var groupOne = myWin.add("group", undefined, "GroupOne"); groupOne.add("radiobutton", undefined, "RadioButton"); myWin.center(); myWin.show(); | |
// running conditions // 1. vertices are entered into array as x,y,xy,xy,xy. has to be done in order of how the mask id drawn as if it was drawn in one stroke of a pen newMask = app.project.item(1).layer(1).Masks.addProperty("Mask"); newMask.inverted = true; myMaskShape = newMask.property("maskShape"); myShape = myMaskShape.value; myShape.vertices = [[0,0],[50,0],[50,50],[0,50]]; myShape.closed = true; myMaskShape.setValue(myShape); | |
// running conditions // 1. vertices are entered into array as x,y,xy,xy,xy. has to be done in order of how the mask id drawn as if it was drawn in one stroke of a pen newMask = app.project.item(1).layer(1).Masks.addProperty("Mask"); newMask.inverted = true; myMaskShape = newMask.property("maskShape"); myShape = myMaskShape.value; myShape.vertices = [[0,0],[50,0],[50,50],[0,50]]; myShape.closed = true; myMaskShape.setValue(myShape); | |
app.project.item(1).layer(1).remove(); | |
app.project.item(1).layer(1)("Masks")(1).remove() | |
app.executeCommand(2004); | |
var radius = 60; var angle = 140; var x = radius * Math.sin(Math.PI * 2 * angle / 360); var y = radius * Math.cos(Math.PI * 2 * angle / 360); alert('Points coors are x='+ Math.round(x * 100) / 100 +', y=' + Math.round(y * 100) / 100) | |
var radius = 60; var angle = 180; var x = radius * Math.sin(Math.PI * 2 * angle / 360) +600; var y = radius * Math.cos(Math.PI * 2 * angle / 360)+600; alert('Points coors are x='+ Math.round(x * 100) / 100 +', y=' + Math.round(y * 100) / 100) | |
// description to stranger // 1. given a radius an angle and a center point return x y coordiantes based on the nagle // 2. // 3. // running condtions: // 1.angel no greate than 360 // 2. // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var radius = 60; var angle = 0; var x = radius * Math.sin(Math.PI * 2 * angle / 360) +600; var y = radius * Math.cos(Math.PI * 2 * angle / 360)+600; alert('Points coors are x='+ Math.round(x * 100) / 100 +', y=' + Math.round(y * 100) / 100) app.endUndoGroup(); | |
// description to stranger // 1. prodived an angler and raius return the x y cooridantea on a circle // 2. // 3. // running condtions: // 1.angel no bigger than 360 // 2. // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var radius = 60; var angle = 140; var x = radius * Math.sin(Math.PI * 2 * angle / 360); var y = radius * Math.cos(Math.PI * 2 * angle / 360); alert('Points coors are x='+ Math.round(x * 100) / 100 +', y=' + Math.round(y * 100) / 100) app.endUndoGroup(); | |
function random1(a,b){ var b; var c = b-a var d = ([Math.floor(Math.random() * c) + a]); return d; } alert(random1(1,5)) | |
https://github.com/n1ckfg/ITP_OpenSourceAnimation/blob/master/2012f/Day08/Scripts/ScriptUI%20Panels/rd_GimmePropPath.jsx | |
var radius = 100 var circumfrence= 2*Math.PI *radius alert(circumfrence) | |
// description to stranger // 1. get circumrefence of cirlce by raidus // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var radius = 100 var circumfrence= 2*Math.PI *radius app.endUndoGroup(); | |
var myComp = app.project.activeItem; var w = myComp.width; var h = myComp.height; alert(w); alert(h); | |
var layObj = app.project.item(1).layer(1) var r = getMaskPaths(layObj); alert("Path Data:\rClosed: " + r[1][0].closed.toString() + "\n" +"FeatherInterps: " + r[1][0].featherInterps.toString() + "\n" +"FeatherRadii: " + r[1][0].featherRadii.toString() + "\n" +"featherRelCornerAngles: " + r[1][0].featherRelCornerAngles.toString() + "\n" +"featherRelSegLocs: " + r[1][0].featherRelSegLocs.toString() + "\n" +"featherTensions: " + r[1][0].featherTensions.toString() + "\n" +"featherTypes: " + r[1][0].featherTypes.toString() + "\n" +"inTangents: " + r[1][0].inTangents.toString() + "\n" +"outTangents: " + r[1][0].outTangents.toString() + "\n" +"vertices: " + r[1][0].vertices.toString()); function getMaskPaths(layObj){ var paths, pathNames, masksGrp, masksGrpLen, curMask; paths = new Array(); pathNames= new Array(); if(layObj instanceof AVLayer){ masksGrp = layObj.property("ADBE Mask Parade"); masksGrpLen = masksGrp.numProperties; if(masksGrpLen > 0){ for(var m=1; m<=masksGrpLen; m++){ curMask = masksGrp.property(m).property("ADBE Mask Shape").value; pathNames.push(masksGrp.property(m).name); paths.push(curMask); } } } if(paths.length > 0){ return [pathNames, paths]; }else{ return null; } } | |
// running condtions // 1. set loop to run for amount of vertices // 2. min check all vertices var vertices_x_array = [] var vertices_y_array = [] for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(1).layer(1)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); alert(min_x) alert(min_y) | |
// description to stranger // 1. get mask top left point // 2. // 3. // running condtions: // 3. corrent proejct item and mask index and layer // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); for(ii=0;ii<4;ii++){ vertices_x_array.push(app.project.item(a).layer(b)("Masks")(1).property("Mask Path").value.vertices[ii][0]) vertices_y_array.push(app.project.item(a).layer(b)("Masks")(1).property("Mask Path").value.vertices[ii][1]) } // // decalre varailbe for minimum valuew of x and y vertices arrays giving you top left point i nsqure var min_x= Math.min(vertices_x_array[0],vertices_x_array[1],vertices_x_array[2],vertices_x_array[3]); var min_y= Math.min(vertices_y_array[0],vertices_y_array[1],vertices_y_array[2],vertices_y_array[3]); app.endUndoGroup(); | |
alert(app.project.item(1).layer(1)("Masks")("Mask 1").property("Mask Path").value.vertices); | |
alert(app.project.item(1).layer(1).property("Effects")("Puppet")("arap")("Mesh")("Mesh 1")("Deform")("Puppet Pin 4")("Position").keyTime(1)) | |
// description to stranger // 1. gets time of first pin key // 2. // 3. // running condtions: alert(app.project.item(2).layer(2).property("Effects")("Puppet")("arap")("Mesh")("Mesh 1")("Deform")("Puppet Pin 4")("Position").keyTime(1)) | |
// description to stranger // 1. gets time of first pin key // 2. // 3. // running condtions: alert(app.project.item(2).layer(2).property("Effects")("Puppet")("arap")("Mesh")("Mesh 1")("Deform")("Puppet Pin 4")("Position").keyTime(1)) | |
// description to stranger // 1. link button to running action // 2. // 3. // running condtions: // 1. // 2. // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // make iwindow var myWin = new Window("palette", "My Window", undefined); // add a gorup to window var groupOne = myWin.add("group", undefined, "GroupOne"); // add button to group var buttonone = groupOne.add("button", undefined, "duplicate layer 2"); // link button to function buttonone.onClick = function () { duplicate1(2); } myWin.center(); myWin.show(); app.endUndoGroup(); | |
// hide layer app.project.item(1).layer(1).enabled = false; // show layer app.project.item(1).layer(1).enabled = true; | |
// import function. place at top of document once $.evalFile( "C:/functions/all functions.jsx"); // function can be executed as if all exist in present document function_from_external_file(); | |
function select(){ for (var i=0; i < arguments.length; i++) { app.project.activeItem.layer(arguments[i]).selected = true; } } select(1,3,7,9); | |
app.project.item(1).layer(1).property("Masks").property("Mask 1").inverted = true | |
// description to stranger // 1. inverts layer mask // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); app.project.item(2).layer(2).property("Masks").property("Mask 1").inverted = true app.endUndoGroup(); | |
// assign variable to layer you want another to move above of var x = app.project.item(1).layer(1); // move the layer app.project.item(1).layer(2).moveBefore(x); | |
app.project.item(1).layer(1).moveToEnd(); | |
// running conditions // 1. order of string in array and action in seonc array has to be the same. the functin basically looks though one and executes what is in the other array in the same position function bledningmode1(a,b){ // set variables for possible blending mode setting var add = BlendingMode.ADD var alphaadd = BlendingMode.ALPHA_ADD var classiccolorburn = BlendingMode.CLASSIC_COLOR_BURN // create array of strings that can be used as possible parameters var blendingmodesstrings = ["add","alphaadd","classiccolorburn"] // create array of the possible blending mode setting variables var blendingmodes = [add,alphaadd,classiccolorburn] // loop thorugh possible strings if string passed in paramter matches item in array assign action to varaible c for(i=0;i var c=blendingmodes[i] } // execute blending mode app.project.activeItem.layer(a).blendingMode = c } bledningmode1(1,"add") | |
// description to stranger // 1. allwos to set a string as parmate rinfucntion calling a vrailbe i nthat function // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion function bledningmode1(a,b){ var add = BlendingMode.ADD var alphaadd = BlendingMode.ALPHA_ADD var classiccolorburn = BlendingMode.CLASSIC_COLOR_BURN var blendingmodesstrings = ["add","alphaadd","classiccolorburn"] var blendingmodes = [add,alphaadd,classiccolorburn] var c = blendingmodes[b] for(i=0;i if(b==blendingmodesstrings[i]) c=blendingmodes[i] } app.project.item(2).layer(a).blendingMode = c } bledningmode1(2,"add") | |
var yyyy = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Position"); function sleep(milliseconds) { var start = new Date().getTime(); for (var i = 0; i < 1e7; i++) { if ((new Date().getTime() - start) > milliseconds){ break; } } } sleep(100000); yyyy.setValueAtTime([1], [2, 2]); | |
// precompose layers 1 and 2 in project number 1 app.project.item(1).layers.precompose(([1,2]), "zzzzz_comp", true); | |
var myComp= app.project.item(1) var idx = []; for (var i = 1; i <= myComp.numLayers; i++){ idx = [i]; myComp.layers.precompose(idx,myComp.layer(i).name,true); } | |
// running conditions // 1. have enough layers // a= proejct number, b= top layer, c = bottom layer function precompose_subsequent(a,b,c){ // make array to put layer to precompose in var layerstoprecompose = []; for (m = 1; m <= c-b+1; m++){ layerstoprecompose.push(b+m-1) } // precompose all in array app.project.item(a).layers.precompose((layerstoprecompose), "zzzzz_comp", true); } precompose_subsequent(1,2,4) | |
// description to stranger // 1. takes an images and make into a pulse by duplciating into a circle then expanding and fading it out // 2. // 3. // running condtions: // 1. Select layer app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ function precompose1(){ var layerstoprecompose = []; for (var k=0; k< arguments.length; k++) { layerstoprecompose.push(arguments[k]); } app.project.activeItem.layers.precompose((layerstoprecompose), "zzzzz_comp", true); } function opacity1(a,b,c){ app.project.item(active_item).layer(a).property("Transform").property("Opacity").setValueAtTime([b],[c]); } function scale1(a,b,c){ app.project.item(active_item).layer(a).property("Transform").property("Scale").setValueAtTime([b], [c,c]); } function precompose3(a117,b117){ // make array to put layer to precompose in var layerstoprecompose117 = []; for (m117 = 1; m117 <= b117-a117+1; m117++){ // add layer 2 to array tobe porcomposed layerstoprecompose117.push(a117+m117-1) } // precompose all in array app.project.activeItem.layers.precompose((layerstoprecompose117), "zzzzz_comp", true); } // a= layer, b= dupclaites, c differnce in int time matching parmater function trail(b140,c140){ for(i140=1;i140<=b140;i140++){ app.project.item(active_item).layer(selected_layer).duplicate(); app.project.activeItem.layer(selected_layer+1).startTime = c140*i140 } precompose3(selected_layer,selected_layer+b140) } // a= start time, b = end time, c= frequency, d= time offset e= redius start, f, radius end, g= scale function pulse(a,b,c,d,e,f,g){ app.project.item(active_item).layer(selected_layer).startTime = a; precompose1(selected_layer) opacity1(selected_layer,a,0) opacity1(selected_layer,a+2,100) opacity1(selected_layer,b-3,100) opacity1(selected_layer,b,0) // set scale scale1(selected_layer,0,g) // decale varailbes for comp width and height var w = app.project.activeItem.width; var h = app.project.activeItem.height; // p[ush circle points of center poiunt and rparmter statrting reisu to arrays var k = 0 var xxpoint = [] var yypoint = [] for(i=0;i<42;i++){ var radius = e; var angle = k; var xpoint = radius * Math.sin(Math.PI * 2 * angle / 360) +w/2; var ypoint = radius * Math.cos(Math.PI * 2 * angle / 360)+h/2; xxpoint.push((Math.round( parseFloat((xpoint))))); yypoint.push((Math.round( parseFloat((ypoint))))); k= k +10 } // p[ush circle points of center poiunt and rparmter end radius to arrays var k = 0 var xxxxpoint = [] var yyyypoint = [] for(i=0;i<42;i++){ var radius2 = f; var angle = k; var xxxpoint = radius2 * Math.sin(Math.PI * 2 * angle*-1 / 360) +w/2; var yyypoint = radius2 * Math.cos(Math.PI * 2 * angle*-1 / 360)+h/2; xxxxpoint.push((Math.round( parseFloat((xxxpoint))))); yyyypoint.push((Math.round( parseFloat((yyypoint))))); k= k +10 } // loop set ducaplites to points i narray at starting second for(i=1; i<40; i++){ app.project.item(active_item).layer(selected_layer).duplicate(); app.project.item(active_item).layer(selected_layer+1).property("ADBE Transform Group").property("ADBE Position").setValueAtTime([0], [xxpoint[i-1], yypoint[i-1]]); } // set chosen layer at 0 to circle start app.project.item(active_item).layer(selected_layer).property("ADBE Transform Group").property("ADBE Position").setValueAtTime([0], [(Math.round( parseFloat((xxpoint[0])))), (Math.round( parseFloat((yypoint[0]))))]); // loop set ducaplites to points i narray at end second for(i=1; i<40; i++){ app.project.item(active_item).layer(selected_layer+i).property("ADBE Transform Group").property("ADBE Position").setValueAtTime([b], [xxxxpoint[i-1], yyyypoint[i-1]]); } // set chosen layer at 0 to circle start app.project.item(active_item).layer(selected_layer).property("ADBE Transform Group").property("ADBE Position").setValueAtTime([0], [(Math.round( parseFloat((xxxxpoint[0])))), (Math.round( parseFloat((yyyypoint[0]))))]); // set chosen layer at 0 to circle start app.project.item(active_item).layer(selected_layer).property("ADBE Transform Group").property("ADBE Position").setValueAtTime([b], [(Math.round( parseFloat((xxxxpoint[0])))), (Math.round( parseFloat((yyyypoint[0]))))]); // remove seelcted layer app.project.item(active_item).layer(selected_layer).remove(); // preocmpose all precompose3(selected_layer,selected_layer+i-2) opacity1(selected_layer,a,0) opacity1(selected_layer,selected_layer+2,100) // trail trail((b-a)/c,d) } pulse(0,10,0.1,1,0,500,30) app.endUndoGroup(); | |
// running conditions // 1. assumes layer already has color blance effect added // 2. assumes frame per 0.03 seconds // set incrmenet for timing var jj = 0; // loop set random hue and color blance per frame for(ii=0;ii<100;ii++){ // set abbreviated varaibles for color balance preperties var x1 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Shadow Red Balance") var x2 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Shadow Green Balance") var x3 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Shadow Blue Balance") var x4 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Midtone Red Balance") var x5 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Midtone Green Balance") var x6 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Midtone Blue Balance") var x7 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Highlight Red Balance") var x8 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Highlight Green Balance") var x9 = app.project.item(1).layer(1).property("Effects").property("Color Balance").property("Highlight Blue Balance") // set random values -100 to 100 x1.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x2.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x3.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x4.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x5.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x6.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x7.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x8.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); x9.setValueAtTime([jj], [Math.floor(Math.random() * 200) + -100]); // increment timing variable jj = jj +0.3 } | |
// description to stranger // 1. Loops though all layers and set them fade in and out for a rnadom amount of times over a random duration within a random period // 2. // 3. // running condtions: // 1. No preexisting opacity keys on layers app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ // function for random integer in range function random1(a76,b76){ var b76; var c76 = b76-a76 var d76 = ([Math.floor(Math.random() * c76) + a76]); return d76; } // function to set layer opacity at time function opacity1(a,b,c){ app.project.item(active_item).layer(a).property("Transform").property("Opacity").setValueAtTime([b],[c]); } // a= min fade ins, b= max fade ins // c= min fade in duration, d= max fade in duration // e= min time of first fade in, f= max time of first fade in // g= min intervial, h= max interval // loop through all layers and for each set function fade_in_out(a,b,c,d,e,f,g,h){ for (var ii = 1; ii <= app.project.activeItem.numLayers; ii++){ // variable for amount of times fade in out var r1 = random1(a,b) // variable for duration of fade in and out var r2 = random1(c,d) // varaible for first fade in var r3 = random1(e,f) var current_time = r3; for(jj=0;jj // variable of interval between fade ins var r4 = random1(g,h); var current_time = current_time +r4; opacity1(ii,current_time,0) opacity1(ii,current_time+r2,100) opacity1(ii,current_time+r2*2,0) } } } // a= min fade ins, b= max fade ins // c= min fade in duration, d= max fade in duration // e= min time of first fade in, f= max time of first fade in // g= min intervial, h= max interval fade_in_out(5,10,1,3,0,5,1,3) app.endUndoGroup(); | |
// generate random integer in range // set range minimum var min =1 // set range maximum var max = 10 // generate random var random_1 = ([Math.floor(Math.random() * (max-min)) + min]); alert(random_1) | |
// description to stranger // 1. Shuffles all layers in selected comp and does rnadom opacity for the first 9 // 2. // 3. // running condtions: // 1. Select a layer // 2. At least 10 layers in comp // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); function random1(a76,b76){ var b76; var c76 = b76-a76 var d76 = ([Math.floor(Math.random() * c76) + a76]); return d76; } // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ { var myComp = app.project.activeItem; var n = myComp.numLayers; var myLayers = []; var myIdx = []; for (var i = 1; i<= n; i++){ myIdx[i-1] = i; myLayers[i-1] = myComp.layer(i); } var idx; var temp; for (var i = 0; i < myIdx.length; i++){ idx = i + Math.floor(Math.random()*(myIdx.length - i)); temp = myIdx[i]; myIdx[i] = myIdx[idx]; myIdx[idx] = temp; } for (var i = 0; i < myIdx.length; i++){ myLayers[myIdx[i]-1].moveToBeginning(); } } for (var ii = 1; ii < app.project.item(active_item).numLayers; ii++){ var r1 = random1(1,100) app.project.item(active_item).layer(ii).property("Transform").property("Opacity").setValueAtTime([0],[r1]); } app.endUndoGroup(); | |
// description to stranger // 1. rotate each layer in compostion by a different random total angle within a different random period of time // 2. // 3. // running condtions: // 1. // allows acess to file with all functions app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ function random1(a76,b76){ var b76; var c76 = b76-a76 var d76 = ([Math.floor(Math.random() * c76) + a76]); return d76; } function rotation1(a,b,c){ app.project.item(active_item).layer(a).property("Transform").property("Rotation").setValueAtTime([b],[c]); } // a= min start time, b- max end time // c= min total rotation angle, d = max total rotation angle function random_rotate(a,b,c,d){ for (var ii = 1; ii <= app.project.activeItem.numLayers; ii++){ var r1 =random1(a+1,b) var r2 =random1(c,d) rotation1(ii,a,0) rotation1(ii,r1,r2) } } random_rotate(0,30,90,3600) app.endUndoGroup(); | |
// description to stranger // 1. random tritone midtones per frame // 2. // 3. // running condtions: // 1. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ app.project.item(active_item).layer(selected_layer).property("Effects").property("CC Toner").property("Tones").setValue(2); app.project.item(active_item).layer(selected_layer).property("Effects")("CC Toner")("Blend w. Original").setValueAtTime([0], [0]); for(ii=0;ii<1000;ii++){ var r1 = random2(0,1) var r2 = random2(0,1) var r3 = random2(0,1) app.project.item(active_item).layer(selected_layer).property("Effects").property("CC Toner").property("Midtones").setValueAtTime([ii*0.03], [r1,r2,r3]); } app.endUndoGroup(); | |
// description to stranger // 1. Random wiggle position // 2. // 3. // running condtions: // 1. // allows acess to file with all functions app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ app.project.item(active_item).layer(selected_layer).property("Position").expression = "wiggle(1,random(1,1000))"; app.endUndoGroup(); | |
// description to stranger // 1. random_brightness_random_contrast_per_frame // 2. // 3. // running condtions: // 1. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); var loop_counter_111 = 0; // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ var x1 = app.project.item(active_item).layer(selected_layer).property("Effects").property("Brightness & Contrast").property("Brightness") var x2 = app.project.item(active_item).layer(selected_layer).property("Effects").property("Brightness & Contrast").property("Contrast") for(ii=0;ii<2000;ii++){ loop_counter_111= loop_counter_111+1; $.writeln("prefix " + loop_counter_111) var random_value_1 = Math.floor(Math.random() * 200) + -100 var random_value_2 = Math.floor(Math.random() * 200) + -100 x1.setValueAtTime([ii*0.03], [0]); x2.setValueAtTime([ii*0.03], [0]); x1.setValueAtTime([ii*0.03], [random_value_1]); x2.setValueAtTime([ii*0.03], [random_value_2]); } app.endUndoGroup(); | |
for (var i = 1; i <= app.project.activeItem.numLayers; i++){ try{ myEffects = app.project.activeItem.layer(i).Effects; for (j = myEffects.numProperties; j > 0; j--){ myEffects.property(j).remove(); } }catch(err){ } } | |
function remove_unmasked_1(){ // loop for amout of layer in comp for (var ii = 1; ii <= app.project.activeItem.numLayers; ii++){ // try setting variable as first mask in layer. if it doesnt have a first mask remove it try { var x = app.project.activeItem.layer(ii)("Masks")(1); } catch(err) { app.project.activeItem.layer(ii).remove(); ii = ii-1 } } } remove_unmasked_1() | |
// description to stranger // 1. remove all in active item wihtout mask // 2. // 3. // running condtions: // assume active item // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); function remove_unmasked_1(){ var myComp = app.project.activeItem; for (var ii = 1; ii <= myComp.numLayers; ii++){ try { var x = myComp.layer(ii)("Masks")(1); } catch(err) { myComp.layer(ii).remove(); ii = ii-1 } } } remove_unmasked_1() app.endUndoGroup(); | |
// assign position value of item 2 layer 2 to variable targetParam = app.project.item(1).layer(1).transform.position; // loop while total keys isnt zero remove first key while (targetParam.numKeys != 0) { // Delete the first Keyframe targetParam.removeKey(1); } | |
app.project.item(1).layer(1)("Effects")(3).remove(); | |
app.project.item(1).layer(1)("Effects")("Hue/Saturation").remove(); | |
// function to run function alert_1(){ alert("hello") } // make iwindow var myWin = new Window("palette", "My Window", undefined); // add a gorup to window var groupOne = myWin.add("group", undefined, "GroupOne"); // add button to group var buttonone = groupOne.add("button", undefined, "alert_1"); // link button to function buttonone.onClick = function () { alert_1(); } myWin.center(); myWin.show(); | |
// define functions function one (){alert("1")}; function two (){alert("2")}; // random number 1-amount of functions in this case 2 var items = [1,2]; var item = items[Math.floor(Math.random()*items.length)]; // if random comes back 1 rrun function 1 if(item == 1){one()}; // if random comes back 2 run function 2 else if(item == 2){two()}; // if none of the expected options some other alert else{alert(0)}; | |
app.executeCommand(23); | |
app.project.item(2).width =2400 app.project.item(2).height =2400 | |
// description to stranger // 1. set comp higehgt and width. often tmepoarlity to avoid preomcpoe cutting edges // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); //increas omcp size increase it offset out of it app.project.item(2).width =2400 app.project.item(2).height =2400 app.endUndoGroup(); | |
// add effect app.project.item(1).layer(1).Effects.addProperty("Reshape"); // set dropdown value app.project.item(1).layer(1).property("Effects").property("Reshape").property("Source Mask").setValue(1); | |
var x = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Position"); var maskvertices = (app.project.item(1).layer(2)("Masks")("Mask 1").property("Mask Path").value.vertices); var totalverticesaspositionos = ((app.project.item(1).layer(2)("Masks")("Mask 1").property("Mask Path").value.vertices).length); for(i=0; i } | |
app.project.item(1).layer(1).property("Masks").property(1).property("Mask Expansion").setValueAtTime([0], [0]); app.project.item(1).layer(1).property("Masks").property(1).property("Mask Expansion").setValueAtTime([5], [100]); | |
// description to stranger // 1. set mask expansion // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); app.project.item(2).layer(2).property("Masks").property(1).property("Mask Expansion").setValueAtTime([0], [0]); app.project.item(2).layer(2).property("Masks").property(1).property("Mask Expansion").setValueAtTime([5], [100]); app.endUndoGroup(); | |
app.project.item(1).layer(1).property('ADBE Mask Parade').property(1).maskMode = MaskMode.SUBTRACT; | |
// description to stranger // 1. set mask mode // 2. // 3. // running condtions: // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); app.project.item(2).layer(2).property('ADBE Mask Parade').property(1).maskMode = MaskMode.SUBTRACT; app.endUndoGroup(); | |
app.project.item(2).openInViewer(); | |
app.project.item(16).layer("Adjustment Layer 5").property("Effects").property("Texturize").property("Texture Layer").setValue(2); | |
{ function myScript(thisObj){ function myScript_buildUI(thisObj){ var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My window name", undefined, {resizeable:true}); res = "group{orientation:'row', allignment:['fill', 'fill'], allignChildren:['fill', 'fill'],\ groupOne: Group{orientation:'column', allignment:['fill', 'fill'], allignChildren:['right', 'fill'],\ mySlider: Slider{text:'my slider', value:100, minvalue:0, maxvalue:100},\ mySliderValue: StaticText{text:'opacity'},\ },\ }"; myPanel.grp = myPanel.add(res); // Defaults //Setup panel sizing myPanel.layout.layout(true); myPanel.grp.minimumSize = myPanel.grp.size; //Make the panel reszeable myPanel.layout.resize(); myPanel.onResizing = myPanel.onResize = function(){this.layout.resize()}; var mySlider =myPanel.grp.groupOne.mySlider mySlider.onChange = function () { var layer2opacity = app.project.item(1).layer(1).property("Transform").property("Opacity") layer2opacity.setValue(mySlider.value); myPanel.grp.groupOne.mySliderValue.text= mySlider.value.toString() } return myPanel; } var myScriptPal = myScript_buildUI(thisObj); if((myScriptPal != null) && (myScriptPal instanceof Window)){ myScriptPal.center(); myScriptPal.show(); } } myScript(this); } | |
// description to stranger // 1. set value by slider // 2. // 3. // running condtions: // 1. script must be placedd in folder adobe after effects\Adobe After Effects CC 2015\Support Files\Scripts\ScriptUI Panels and load after last edit restaritngfater effects // 2. meant so gui is palced docakble in a main window right of preview // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); { function myScript(thisObj){ function myScript_buildUI(thisObj){ var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My window name", undefined, {resizeable:true}); res = "group{orientation:'row', allignment:['fill', 'fill'], allignChildren:['fill', 'fill'],\ groupOne: Group{orientation:'column', allignment:['fill', 'fill'], allignChildren:['right', 'fill'],\ mySlider: Slider{text:'my slider', value:100, minvalue:0, maxvalue:100},\ mySliderValue: StaticText{text:'opacity'},\ },\ }"; myPanel.grp = myPanel.add(res); // Defaults //Setup panel sizing myPanel.layout.layout(true); myPanel.grp.minimumSize = myPanel.grp.size; //Make the panel reszeable myPanel.layout.resize(); myPanel.onResizing = myPanel.onResize = function(){this.layout.resize()}; var mySlider =myPanel.grp.groupOne.mySlider mySlider.onChange = function () { var layer2opacity = app.project.item(2).layer(2).property("Transform").property("Opacity") layer2opacity.setValue(mySlider.value); myPanel.grp.groupOne.mySliderValue.text= mySlider.value.toString() } return myPanel; } var myScriptPal = myScript_buildUI(thisObj); if((myScriptPal != null) && (myScriptPal instanceof Window)){ myScriptPal.center(); myScriptPal.show(); } } myScript(this); } | |
// hide layer app.project.item(1).layer(1).enabled = false; // show layer app.project.item(1).layer(1).enabled = true; | |
var x = app.project.activeItem.layer("white background"); x.enabled = true; x.enabled = false; | |
// x,y is the point to test // cx, cy is circle center, and radius is circle radius function pointInCircle(x, y, cx, cy, radius) { var distancesquared = (x - cx) * (x - cx) + (y - cy) * (y - cy); return distancesquared <= radius * radius; } alert(pointInCircle(700,700,600,600,300)); | |
// description to stranger // 1. tests if a point is within a cirlc ebased on center poition of the cirlce and its radius // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // x,y is the point to test // cx, cy is circle center, and radius is circle radius function pointInCircle(x, y, cx, cy, radius) { var distancesquared = (x - cx) * (x - cx) + (y - cy) * (y - cy); return distancesquared <= radius * radius; } alert(pointInCircle(700,700,600,600,300)); app.endUndoGroup(); | |
//a = layer // b= start time // c= end time // d = particle prdocuer start point x // e = particle producer start point y // f = particle producer end point x g = particle producer end point y // h= radius x , i radius y // j= birth rate // k = longevity // l = velocity // m = gravity // n = birth color r, o = birth color g p = birth color b q = birth color a // r = death color r, s = death color g t = death color b u = death color a function to_dust_1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){ // precompose app.project.activeItem.layers.precompose(([a]), "zzzzz_comp", true); // duplicate app.project.activeItem.layer(a).duplicate(); // add cc paticle 2 app.project.activeItem.layer(a).Effects.addProperty("CC Particle Systems II"); // set source from alapha app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Source Alpha Inheritance").setValueAtTime([0], [1]); // set keying of of patice 2 effect app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Position").setValueAtTime([b], [d,e]); app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Position").setValueAtTime([c], [f,g]); // set x and y radius of particle app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Radius X").setValueAtTime([b], [h]); app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Radius Y").setValueAtTime([b], [i]); // set particle birth rate app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Birth Rate").setValueAtTime([b], [j]); // set particle longevity app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Longevity (sec)").setValue([k]); // set particle velocity app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Velocity").setValueAtTime([b], [l]); // set particle gravity app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Gravity").setValueAtTime([b], [m]); // set particle resistance app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Resistance").setValueAtTime([b], [20]); // set birth color app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Birth Color").setValueAtTime([b], [n/255,o/255,p/255,q/255]); // set death color app.project.activeItem.layer(a).property("Effects").property("CC Particle Systems II").property("Death Color").setValueAtTime([b], [r/255,s/255,t/255,u/255]); // add wipe effect to bottom duplciate app.project.activeItem.layer(a+1).Effects.addProperty("Linear Wipe"); // key wipe effect matching keyed paricle movmvent app.project.activeItem.layer(a+1).property("Effects").property("Linear Wipe").property("Transition Completion").setValueAtTime([b], [0]); app.project.activeItem.layer(a+1).property("Effects").property("Linear Wipe").property("Transition Completion").setValueAtTime([c], [100]); //preomcpose app.project.activeItem.layers.precompose(([a,a+1]), "zzzzz_comp", true); } //a = layer // b= start time // c= end time // d = particle prdocuer start point x // e = particle prdocuer start point y // f = particle prdocuer end point x g = particle prdocuer end point y // h= radius x , i radius y // j= birth rate // k = longevity // l = velocity // m = gravity // n = brith color r, o = brith color g p = brith color b q = brith color a // r = death color r, s = death color g t = death color b u = death color a to_dust_1(1,0,2,0,600,1200,600,0,90,10,2,1,-0.3,211,228,26,0,211,228,26,0) | |
// description to stranger // 1. to dust fade out // 2. // 3. // running condtions: // 1. item 2 in porject a preomcpositino wiht at east 2 layer and with alow number first laetter so it wont get oredoered o ncreaiton of new poreocmtion // 2. folde rof rsources to import named sepcifically as specific in function import2. precomposes it all and trails again 10 duplicates 0.1 // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); //a = layer // b= start time // c= end time // d = particle prdocuer start point x // e = particle prdocuer start point y // f = particle prdocuer end point x g = particle prdocuer end point y // h= radius x , i radius y // j= birth rate // k = longevity // l = velocity // m = gravity // n = brith color r, o = brith color g p = brith color b q = brith color a // r = death color r, s = death color g t = death color b u = death color a function to_dust_1(a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u){ // precompose precompose1(a) // ducpalite duplicate1(a) // add cc paticle 2 app.project.item(2).layer(a).Effects.addProperty("CC Particle Systems II"); // set source from alapha app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Source Alpha Inheritance").setValueAtTime([0], [1]); // set keying of of patice 2 effect app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Position").setValueAtTime([b], [d,e]); app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Position").setValueAtTime([c], [f,g]); // set x and y radius of particle app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Radius X").setValueAtTime([b], [h]); app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Radius Y").setValueAtTime([b], [i]); // set particle birth rate app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Birth Rate").setValueAtTime([b], [j]); // set particle longevity app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Longevity (sec)").setValue([k]); // est parcile velocity app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Velocity").setValueAtTime([b], [l]); // est paricle gravity app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Gravity").setValueAtTime([b], [m]); // st paricle resistance app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Resistance").setValueAtTime([b], [20]); // set birht color app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Birth Color").setValueAtTime([b], [n/255,o/255,p/255,q/255]); // set death color app.project.item(2).layer(a).property("Effects").property("CC Particle Systems II").property("Death Color").setValueAtTime([b], [r/255,s/255,t/255,u/255]); // add wipe effect to bottom duplciate app.project.item(2).layer(a+1).Effects.addProperty("Linear Wipe"); // key wipe effect mathcing keyed paricle movmvent app.project.item(2).layer(a+1).property("Effects").property("Linear Wipe").property("Transition Completion").setValueAtTime([b], [0]); app.project.item(2).layer(a+1).property("Effects").property("Linear Wipe").property("Transition Completion").setValueAtTime([c], [100]); //p reomcpose precompose1(a,a+1) } //a = layer // b= start time // c= end time // d = particle prdocuer start point x // e = particle prdocuer start point y // f = particle prdocuer end point x g = particle prdocuer end point y // h= radius x , i radius y // j= birth rate // k = longevity // l = velocity // m = gravity // n = brith color r, o = brith color g p = brith color b q = brith color a // r = death color r, s = death color g t = death color b u = death color a to_dust_1(2,0,5,0,600,1200,600,0,90,10,2,1,-0.3,211,228,26,0,211,228,26,0) app.endUndoGroup(); | |
// description to stranger // 1. Duplicates selected layer specified amount of times with a time offset with each duplicate // 2. // 3. // running condtions: // 1. Select layer // 2. More visible if applied to a moving layer rather than a still one // allows acess to file with all functions app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ function precompose3(a117,b117){ // make array to put layer to precompose in var layerstoprecompose117 = []; for (m117 = 1; m117 <= b117-a117+1; m117++){ // add layer 2 to array tobe porcomposed layerstoprecompose117.push(a117+m117-1) } // precompose all in array app.project.activeItem.layers.precompose((layerstoprecompose117), "zzzzz_comp", true); } // a= layer, b= dupclaites, c differnce in int time matching parmater function trail(b140,c140){ for(i140=1;i140<=b140;i140++){ app.project.item(active_item).layer(selected_layer).duplicate(); app.project.activeItem.layer(selected_layer+1).startTime = c140*i140 } precompose3(selected_layer,selected_layer+b140) } trail(10,1) app.endUndoGroup(); | |
// description to stranger // 1. Duplicates selected layer random amount of times with a random time offset with each duplicate // 2. // 3. // running condtions: // 1. Select layer // 2. More visible if applied to a moving layer rather than a still one // allows acess to file with all functions app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ function random1(a76,b76){ var b76; var c76 = b76-a76 var d76 = ([Math.floor(Math.random() * c76) + a76]); return d76; } function precompose3(a117,b117){ // make array to put layer to precompose in var layerstoprecompose117 = []; for (m117 = 1; m117 <= b117-a117+1; m117++){ // add layer 2 to array tobe porcomposed layerstoprecompose117.push(a117+m117-1) } // precompose all in array app.project.activeItem.layers.precompose((layerstoprecompose117), "zzzzz_comp", true); } // a= min duplicates, b= max duplicates // c= min time offset, d= max time offset function trail(a,b,c,d){ var r1 = random1(a,b,); var r2 = random1(c,d); for(i=1;i<=r1;i++){ app.project.item(active_item).layer(selected_layer).duplicate(); app.project.activeItem.layer(selected_layer+1).startTime = r2*i } precompose3(selected_layer,selected_layer+r1) } trail(5,20,1,10) app.endUndoGroup(); | |
app.executeCommand(16); | |
// loop thorugh all layers in proejct item by total number of layers in that item setting them to unshow for (var i = 1 ; i <= app.project.activeItem.numLayers; i++){ app.project.item(1).layer(i).enabled = false; } | |
// description to stranger // 1. loop thorugh all layers in proejct item yb tital number of layer in that item setting them to unshow // 2. // 3. // running condtions: // 1. // 2. // 3. // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/scripts/all/functions/all functions.jsx"); app.beginUndoGroup("entire code"); // loop thorugh all layers in proejct item yb tital number of layer in that item setting them to unshow for (var i = 1 ; i <= app.project.activeItem.numLayers; i++){ app.project.item(2).layer(i).enabled = false; } app.endUndoGroup(); | |
// description to stranger // 1. Wiggle all transforms // 2. // 3. // running condtions: // 1. Select layer app.beginUndoGroup("entire code"); // get selected layer var selected_layer = app.project.activeItem.selectedLayers[0].index; // get active ittem // ./. var active_item = 0; for (var ii = 1; ii <= app.project.numItems; ii++){ if (app.project.item(ii) instanceof CompItem && app.project.item(ii).name == app.project.activeItem.name){ active_item = ii; } } // /./ app.project.item(active_item).layer(selected_layer).property("Position").expression = "wiggle(1,random(0.1,1000))"; app.project.item(active_item).layer(selected_layer).property("Rotation").expression = "wiggle(1,random(0.1,360))"; app.project.item(active_item).layer(selected_layer).property("Opacity").expression = "wiggle(1,random(0.1,100))"; app.project.item(active_item).layer(selected_layer).property("Scale").expression = "wiggle(1,random(0.1,25))"; app.endUndoGroup(); | |
$.writeln("hello") | |
// description to stranger // 1. // 2. // 3. // running condtions: // allows acess to file with all functions $.evalFile( "C:/Users/mr big/Dropbox/code/extend script/after effects/snippets/functions/all functions.jsx"); app.beginUndoGroup("entire code"); $.writeln("0ss") app.endUndoGroup(); | |
// running condtions: // 1. txt file at path var outfile = File("e:\\1.txt"); outfile.open('a'); if (outfile !== '') { outfile.writeln("hello"); outfile.close(); } |